package org.looom.orglooomschool;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class Login extends AppCompatActivity {
    private Button bt;
    private EditText uid,pwd;
    String s1,s2;
    @SuppressLint("MissingInflatedId")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        bt=findViewById(R.id.button3);
        uid=findViewById(R.id.editTextName);
        pwd=findViewById(R.id.editTextpw);
        bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(Login.this, Sign.class);
                s1=uid.getText().toString();
                s2=pwd.getText().toString();
                if(s1.equals("QIT2025")&&s2.equals("123123"))
                {
                    intent.putExtra("account",s1);
                    intent.putExtra("password",s2);
                    startActivity(intent);
                }
                else
                {
                    //提示账号或密码错误
                    Toast.makeText(Login.this,"账号或密码错误",Toast.LENGTH_LONG).show();
                }
            }
        });
    }
}
